import request from '@/utils/request'


/**
 * 获取贴标工单详情
 * @param id
 * @returns {Promise | Promise<unknown>}
 */
export function getLabelOrderInfo(id){
  return request({
    url: `/labelOrder/getLabelOrderInfo/${id}`,
    method: 'get',
    handleError: true,
  })
}

/**
 * 确认工单
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export function confirmLabelOrder(data){
  return request({
    url: `/labelOrder/confirmLabelOrder`,
    method: 'post',
    handleError: true,
    data,
  })
}

/**
 * 修改工单
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export function editLabelOrder(data){
  return request({
    url: `/labelOrder/editLabelOrder`,
    method: 'post',
    handleError: true,
    data,
  })
}


/**
 * 获取贴标工单
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export function getLabelList(params = {}){
  return request({
    url: `/labelOrder/getLabelList`,
    params
  })
}


/**
 * 获取商品可贴标的商品
 * @param suitId
 * @returns {Promise | Promise<unknown>}
 */
export function getGoodsInventoryBySuitId(suitId){
  return request({
    url: `/labelOrder/getGoodsInventoryBySuitId/${suitId}`,
    method: 'get',
  })
}
